﻿Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Reflection
Imports System.Xml.Serialization
'Imports Jayrock.Json.Conversion
'Imports Newtonsoft.Json
'Imports Newtonsoft.Json.Linq

Namespace Pop.Api.Parser

    ''' <summary>
    ''' POP Json响应通用解释器。
    ''' </summary>
    Public Class PopJsonParser(Of T As PopResponse)
        Implements IPopParser(Of T)

        Public Function Parse(ByVal body As String) As T Implements IPopParser(Of T).Parse

            Dim rsp As T = Nothing

            If (rsp Is Nothing) Then
                rsp = Activator.CreateInstance(Of T)()
            End If
            If (Not (rsp) Is Nothing) Then
                rsp.Body = body
            End If
            Return rsp

        End Function


    End Class

End Namespace